package com.moon.spring.test;

import com.moon.spring.entity.UserEntity;

import java.lang.reflect.Field;
import java.util.Arrays;

/**
 * @ClassName: test01
 * @Description: TODD
 * @Author: 郭正洋
 * @Date: 2022/10/10 14:30
 * @Vsersion: 1.0.0
 **/
public class test01 {

	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
		Class c = Class.forName("com.moon.spring.entity.UserEntity");
		UserEntity userEntity = (UserEntity) c.newInstance();
		Field[] fields = c.getFields();
		Arrays.stream(fields).forEach((item) ->{
			System.out.println(item);
		});
		userEntity.setUserName("xiaoguo");
		System.out.println(userEntity);
		//ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("");
	}
}
